// 包含 n 个接口请求函数的模块
// 函数返回值：promise 对象
import ajax from './ajax'

//使用 mock 模拟接口
// 1. 获取商家商品数组
export const reqGoodsList = () => ajax('./goods')


// 二、商品
// 1.商品分类
export const reqProductCategory = () => ajax(`/api/shop/getShopCategory`);
// 2.商品(根据分类查)
// export const reqProductByCategory = (categoryId) => ajax(`/api/shop/getShopByCategory`, {
//     categoryId
// });
// 3.查所有商品
export const reqProductAll = (pageNum, pageSize) => ajax(`/api/shop/getShopAllV2`, {
    pageNum,
    pageSize
});
// 4.加入购物车
export const addShopCart = (userId, shopId, shopCount) => ajax(`/api/shop/addShopCart`, {
    userId,
    shopId,
    shopCount
}, "POST");
// 5.用户购物车
export const reqShopCart = (userId) => ajax(`/api/shop/getShopCart`, {
    userId
});
// 6.添加商品
export const addShop = (originalPrice, shopName, shopIntroduction, scId, shopStatus, coverImg) => ajax(`/api/admin/shop/addShop`, {
    originalPrice,
    shopName,
    shopIntroduction,
    scId,
    shopStatus,
    coverImg
});
// 7.删除商品
export const deleteShop = (shopId) => ajax(`/api/admin/shop/deleteShop`, {
    shopId
});
// 8.批量删除商品
export const deleteShops = (shopIds) => ajax(`/api/admin/shop/deleteShops`, {
    shopIds
}, "POST");
// 9.变更购物车
export const changeShopCart = (userId, shopId, shopCount) => ajax(`/api/shop/changeShopCart`, {
    userId,
    shopId,
    shopCount
}, "POST");